package cn.tedu.boot011;

public class ceshi {
    public static void main(String[] args) {
        //完全继承--向上造型
        Father father = new Brother();
        father.fun();
        father.f();
        System.out.println(father.s);
        System.out.println(father.str);
        //
        Brother brother = new Brother();
        brother.f();
        brother.fun();
        System.out.println(brother.str);
        System.out.println(brother.s);
        System.out.println("-----------------------------------");
        //判断是否能被重写
        Father fa = new son();
        System.out.println(fa.s);
        System.out.println(fa.str);
        fa.f();
        fa.fun();

        //
        son s = new son();
        s.f();
        s.fun();
        System.out.println(s.str);
        System.out.println(s.s);
    }
}
